import { defineConfig } from 'vitepress'

// https://vitepress.dev/reference/site-config
export default defineConfig({
  title: 'jsgong ',
  description: 'Hard work will win',
  base: './', //默认路径
  dest: './dist',
  // favicon: "/icon.png",
  // head: [
  //   [ 'link', { rel: 'shortcut icon', type: 'image/png', href: '/icon.png' }],
  // ],
  head: [
    ['link', { rel: 'preconnect', href: 'https://fonts.gstatic.com', crossorigin: '' }],
    // 渲染为: <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
    ['link', { rel: 'icon', href: './icon.png' }],
    ['meta', { name: 'keywords', content: '前端' }],
    // 渲染为: <link rel="icon" href="/logo.svg" />
  ],
  themeConfig: {
    logo: '/icon.png',
    search: {
      provider: 'local',
    },
    docFooter: { prev: '上一篇', next: '下一篇' },
    // https://vitepress.dev/reference/default-theme-config
    nav: [
      // { text: 'Home', link: '/' },
      // { text: 'Examples', link: '/examples' },
      {
        text: '开发篇',
        // collapsed: true,
        items: [
          { text: 'css', link: '/css/' },
          { text: 'js', link: '/js/' },
          { text: 'git', link: '/git/' },
          { text: 'nvm', link: '/nvm/' },
          { text: 'app', link: '/app/' },
          { text: 'vue2', link: '/vue2/' },
          { text: 'vite-press', link: '/vite-press' },
        ],
      },
      {
        text: '案例篇',
        // collapsed: true,
        items: [
          { text: 'uni-app vue3-商城', link: '/learn/uni/' },
          { text: 'pc vue3-商城', link: '/learn/vue3/' },
          { text: 'pc vue3-甄选', link: '/learn/vue3-2/' },
        ],
      },
      {
        text: '理论篇',
        // collapsed: true,
        items: [
          { text: 'typescript', link: '/learn/ts/' },
          { text: 'nest', link: '/nest/' },
          { text: 'linux', link: '/linux/' },
          { text: 'nginx', link: '/nginx/' },
          { text: 'docker', link: '/docker/' },
          { text: 'jenkins', link: '/jenkins/' },
        ],
      },
      {
        text: '服务篇',
        // collapsed: true,
        items: [
          { text: 'spring', link: '/spring/' },
          { text: '网络和协议', link: '/network/' },
        ],
      },

      {
        text: '工具',
        // collapsed: true,
        items: [
          { text: 'vscode', link: '/tool/vscode' },
          { text: 'ps1-sh-cmd脚本', link: '/tool/ps1-sh-cmd' },
        ],
      },
    ],
    lastUpdated: true,
    themeConfig: {
      lastUpdatedText: '最近更新时间',
    },
    sidebar: {
      '/spring/': [
        {
          text: 'spring',
          items: [
            { text: 'spring', link: '/spring/' },
            { text: 'sql', link: '/spring/sql' },
            { text: '事务', link: '/spring/transactional' },
            { text: 'ssm', link: '/spring/ssm' },
            { text: 'spring-mvc', link: '/spring/spring-mvc' },
            { text: 'spring-cloud', link: '/spring/spring-cloud' },
            // { text: 'myBatis', link: '/java/my-batis/' },
            // { text: 'maven', link: '/spring/maven/' },

          ]
        }
      ],
      '/nginx/': [
        {
          text: 'nginx',
          items: [
            { text: 'nginx', link: '/nginx/' },
            { text: 'command', link: '/nginx/command' },
            { text: 'curl工具', link: '/nginx/curl' },
            { text: 'iptables', link: '/nginx/iptables' },
            { text: 'keepalive', link: '/nginx/keepalive' },
            { text: 'rewrite', link: '/nginx/rewrite' },
            { text: 'module', link: '/nginx/module' },
            { text: 'rsync-inotify', link: '/nginx/rsync-inotify' },
            { text: 'cache', link: '/nginx/cache' },
            { text: 'cp', link: '/nginx/cp' },
            { text: 'MaxMind', link: '/nginx/maxmind' },
            { text: 'lua', link: '/nginx/lua' },

          ],
        },
      ],
      '/learn/uni/': [
        {
          text: 'uni-app|vue3|/ts',
          items: [
            { text: 'uni-app', link: '/learn/uni/' },
            { text: 'vue3', link: '/learn/uni/vue3' },
            { text: 'ts', link: '/learn/uni/ts' },
          ],
        },
      ],
      '/learn/ts/': [
        {
          text: 'ts',
          items: [
            { text: '基础', link: '/learn/ts/' },
            { text: '泛型', link: '/learn/ts/generic' },
            { text: 'utility-types', link: '/learn/ts/utility-types' },
          ],
        },
      ],
      '/docker/': [
        {
          text: 'docker',
          items: [
            { text: 'docker', link: '/docker/' },
            { text: 'linux镜像', link: '/docker/linux' },
            { text: '镜像源配置', link: '/docker/source' },
            { text: 'yum-wget-apt', link: '/docker/yum-wget-apt' },
          ],
        },
      ],
      '/app/': [
        {
          text: 'app开发',
          items: [
            { text: '开发问题', link: '/app/' },
            { text: 'android', link: '/app/android' },
            { text: 'ios', link: '/app/ios' },
          ],
        },
      ],
      '/tool/': [
        {
          text: '开发工具',
          items: [
            { text: 'vscode', link: '/tool/vscode' },
            { text: 'software', link: '/tool/software' },
          ],
        },
      ],
      '/css/': [
        {
          text: 'css',
          items: [
            { text: 'css', link: '/css/' },
            { text: 'scss', link: '/css/scss' },
            { text: 'scss示例', link: '/css/scss-examples' },
            { text: 'px', link: '/css/px' },
            { text: 'scope', link: '/css/scope' },

          ],
        },
      ],
      '/js/': [
        {
          text: 'js',
          items: [
            { text: 'js', link: '/js/' },
            { text: 'websocket', link: '/js/websocket' },
            { text: '自定工具', link: '/js/tool' },
            { text: 'promise', link: '/js/promise' },
            { text: 'moment', link: '/js/moment' },
            { text: 'history', link: '/js/history' },
            { text: 'ssd', link: '/js/ssd' },
            { text: 'js生态', link: '/js/js-ecology' },
            { text: 'height', link: '/js/height' },
            { text: 'regexp', link: '/js/regexp' },

          ],
        },
      ],

      '/git/': [
        {
          text: 'git',
          items: [
            { text: 'git配置', link: '/git/' },
            { text: 'git指令', link: '/git/git-command' },
          ],
        },
      ],
      '/nvm/': [
        {
          text: 'nvm',
          // collapsed: true,
          items: [
            { text: 'nvm', link: '/nvm/' },
            { text: 'ndoe', link: '/nvm/node' },
            { text: 'pm2', link: '/nvm/pm2' },
            { text: 'npm|yarm|pnpm', link: '/nvm/npm-yarm-pnpm' },
          ],
        },
      ],
      '/linux/': [
        {
          text: 'Linux',
          // collapsed: true,
          items: [
            { text: 'Linux', link: '/linux/' },
            { text: '用户/组管理/管理权限', link: '/linux/rwx' },
            { text: '磁盘管理', link: '/linux/lsblk' },
            { text: '网络/进程/服务管理', link: '/linux/ps' },
            { text: '定时任务', link: '/linux/crond' },
            { text: 'rpm/yum', link: '/linux/rpm-yum' },
            { text: '安装jdk', link: '/linux/product' },
            { text: 'web容器/linux镜像', link: '/linux/web-container' },
            { text: 'shell', link: '/linux/shell' },
            { text: 'ubuntu', link: '/linux/ubuntu' },
            { text: 'nginx', link: '/linux/nginx' },
          ],
        },
      ],
      '/vue2/': [
        {
          text: 'PC端',
          items: [
            { text: 'vue2', link: '/vue2/' },
            { text: 'element', link: '/vue2/element' },
            { text: 'echarts', link: '/vue2/echarts' },
            { text: 'axios', link: '/vue2/axios' },
            { text: 'vue-router', link: '/vue2/vue-router' },
            { text: 'vuex', link: '/vue2/vuex' },
            { text: 'i18n', link: '/vue2/i18n' },
            { text: 'env', link: '/vue2/env' },
            { text: 'vue-cli', link: '/vue2/vue-cli' },
            { text: '自定义plugin', link: '/vue2/plugin' },
            
          ],
        },
        {
          text: '移动端',
          items: [{ text: 'vant', link: '/vue2/vant' }],
        },
      ],
    },
    footer: {
      message: 'Released under the MIT License.',
      copyright: 'Copyright © 2023-present jsgong',
    },

    socialLinks: [{ icon: 'github', link: 'https://github.com/vuejs/vitepress' }],
  },
})
